package com.lzhsite.technology.designPattern.visitor.DepartmentDemo;

public class ClientForDepartmentDemo
{
    public static void main(String[] args)
    {
        Visitor ceo = new CEO();
        Visitor a = new A();
        Visitor b = new B();
        Corporation partA = new PartA();
        Corporation partB = new PartB();
        ObjectStructure objectStructure = new ObjectStructure();
        objectStructure.addVisitor(partA);
        objectStructure.addVisitor(partB);
        objectStructure.accept(ceo);
        objectStructure.accept(a);
        objectStructure.accept(b);
    }
}
